<template>
  <div class="mall">
    <mall-nav-bar/>
    <mall-swiper/> 
    <mall-type @handleType="getGoods" />
    <mall-goods :goods="goods" />
    <!-- <release @click.native="to_release" /> -->
  </div>
</template>

<script>
import Release from '../../components/Release/Release.vue'
import MallNavBar from './MallNavBar.vue'
import MallSwiper from './MallSwiper.vue'
import MallType from './MallType'
import MallGoods from './MallGoods'
export default {
  name: '',
  components:{
    MallNavBar,
    MallSwiper,
    Release,
    MallType,
    MallGoods
  },
  data () {
    return {
      goods:[]
    }
  },
  mounted(){  
  },
  activated(){
    this.getGoods('new')
  },
  methods:{
  getGoods(type){
    this.$axios({
      url:'/mall/goods',
      method:'get',
      params:{
        type:type
      }
    }).then(res=>{
      this.goods = res.data
      console.log(this.goods)
    })
  }
}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.mall{
  overflow: hidden;
  padding-top: 44px;
  padding-bottom: 50px;
}
</style>